/**
 * 
 */
package cn.ad.server.web.spring.service.components.adtraffic;

import java.util.HashMap;
import java.util.Map;

/**
 * 流量实体
 * 描述流量请求或者流量响应等流量相关实体
 * @author WU CHENGJUN
 */
public abstract class TrafficEntity {
	
	/**
	 * 扩展属性
	 */
	private Map<String, Object> exParams = new HashMap<>();

	public Map<String, Object> getExParams() {
		return exParams;
	}

	public void setExParams(Map<String, Object> exParams) {
		this.exParams = exParams;
	}
	
	/**
	 * 添加扩展参数
	 * @param name
	 * @param value
	 */
	public void addExParam(String name, Object value){
		if(exParams != null){
			exParams.put(name, value);
		}
	}
	
	/**
	 * 根据扩展参数名称获取扩展参数
	 * @param name
	 * @return
	 */
	public Object getExParam(String name){
		if(exParams != null){
			return exParams.get(name);
		}else{
			return null;
		}
	}
}
